<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>new (MediaHighlight)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File lib/media_highlight.rb, line 7</span>
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">element</span>)
    <span class="ruby-ivar">@id</span> = <span class="ruby-identifier">element</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">'id'</span>]
    <span class="ruby-ivar">@date</span> = <span class="ruby-identifier">element</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">'date'</span>]
    <span class="ruby-ivar">@type</span> = <span class="ruby-identifier">element</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">'type'</span>]
    <span class="ruby-ivar">@v</span> = <span class="ruby-identifier">element</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">'v'</span>]
    <span class="ruby-ivar">@headline</span> = <span class="ruby-identifier">element</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">&quot;headline&quot;</span>].<span class="ruby-identifier">text</span>
    <span class="ruby-ivar">@duration</span> = <span class="ruby-identifier">element</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">&quot;duration&quot;</span>].<span class="ruby-identifier">text</span>
    <span class="ruby-ivar">@thumb_url</span> = <span class="ruby-identifier">element</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">&quot;thumb&quot;</span>].<span class="ruby-identifier">text</span>
    <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">element</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">&quot;url[@playback_scenario='FLASH_400K_600X338']&quot;</span>]
      <span class="ruby-ivar">@res_400_url</span> = <span class="ruby-identifier">element</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">&quot;url[@playback_scenario='FLASH_400K_600X338']&quot;</span>].<span class="ruby-identifier">text</span>
    <span class="ruby-keyword kw">else</span>
      <span class="ruby-ivar">@res_400_url</span> = <span class="ruby-keyword kw">nil</span>
    <span class="ruby-keyword kw">end</span>
    <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">element</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">&quot;url[@playback_scenario='FLASH_500K_512X288']&quot;</span>]
      <span class="ruby-ivar">@res_500_url</span> = <span class="ruby-identifier">element</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">&quot;url[@playback_scenario='FLASH_500K_512X288']&quot;</span>].<span class="ruby-identifier">text</span>
    <span class="ruby-keyword kw">else</span>
      <span class="ruby-ivar">@res_500_url</span> = <span class="ruby-keyword kw">nil</span>
    <span class="ruby-keyword kw">end</span>
    <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">element</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">&quot;url[@playback_scenario='FLASH_800K_640X360']&quot;</span>]
      <span class="ruby-ivar">@res_800_url</span> = <span class="ruby-identifier">element</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">&quot;url[@playback_scenario='FLASH_800K_640X360']&quot;</span>].<span class="ruby-identifier">text</span>
    <span class="ruby-keyword kw">else</span>
      <span class="ruby-ivar">@res_800_url</span> = <span class="ruby-keyword kw">nil</span>
    <span class="ruby-keyword kw">end</span>
  <span class="ruby-keyword kw">end</span></pre>
</body>
</html>